package fudan.se.project.repository.projection.summary;


import fudan.se.project.domain.conference.Topic;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

public class TopicSummary {


    private Topic topic;


    public TopicSummary(Topic topic) {
        this.topic = topic;
    }

    public Long getId() {
        return topic.getId();
    }

    public String getName() {
        return topic.getName();
    }

    public static TopicSummary summarize(Topic topic) {
        return new TopicSummary(topic);
    }

    public static List<TopicSummary> summarize(Collection<Topic> topics) {
        ArrayList<TopicSummary> arrayList = new ArrayList<>(topics.size());
        for (Topic value : topics) {
            arrayList.add(summarize(value));
        }
        return arrayList;
    }
}
